home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / batsec.zip / CHAPT1 next >
Text File  |  1992-03-04  |  6KB  |  193 lines

  1.  
  2.         
  3.                             Chapter 1      
  4.  
  5.                    Introduction To Batch (Bat) Files
  6.  
  7.             Batch File commands are the most powerful and
  8.             versatile of the DOS commands.  Writing Batch Files
  9.             is the best way to learn how to use the DOS commands.
  10.  
  11.             In the next lessons you will write many Batch Files.
  12.             You'll have an opportunity to see these Batch files
  13.             come alive with the Menus, Programs and color
  14.             combinations. You'll experience a sense of power
  15.             that you have over the computer.
  16.  
  17.             This is a real accomplishment to learn one of
  18.             the most powerful and useful parts of DOS. You'll be
  19.             one of the few persons who'll know how to write a
  20.             Batch File, a Program and a Menu---and in color.   
  21.  
  22.             HOW TO WRITE BATCH FILES
  23.  
  24.             BATCH (BAT) FILE
  25.             Bat (short for Batch File) is not a DOS command,
  26.             but a file that is created with the Copy Command. It
  27.             has special powers given to it by DOS. Bat Files can
  28.             instruct the computer (DOS)) to carry out commands.
  29.  
  30.             Batch File commands can make the computer (DOS)
  31.             create Menu-Driven-Programs;  automate many DOS
  32.             functions; beep;  blink;  change colors;  show you
  33.             what's in a file;  print a file, and perform many other
  34.             functions. 
  35.  
  36.             GETTING STARTED
  37.             To do the Lessons from this disk or from the
  38.             Manual, you must first format a disk with the System
  39.             files so it will start your computer.
  40.  
  41.             FORMATTING A DISK
  42.             If you have only one disk drive, type the following
  43.             next to the A> prompt:
  44.                         Format A:/S         <press the Enter key>
  45.  
  46.             The computer will instruct you on what to do.
  47.  
  48.             If you have two disk drives, insert your DOS disk
  49.             into drive A. Insert a Blank disk into drive B:.
  50.             Now type the following next to the A prompt:
  51.                         Format B:/S
  52.  
  53.             When formatting is complete remove both disks.
  54.             Insert your formatted disk (from drive B>)
  55.             into the A> drive.
  56.             
  57.             THE COPY COMMAND
  58.             The most versatile DOS command is the Copy command.
  59.             With the Copy command all sorts of Batch Files can
  60.             be created. The Batch Files being a special DOS file
  61.             can give the computer all sorts of commands
  62.                                -3-
  63.  
  64.  
  65.  
  66.  
  67.  
  68.             from copying a file to formatting a disk.
  69.             In this lesson the interest is in writing Batch Files,
  70.             Programs and Menus. All of which the Batch File
  71.             does very well.
  72.  
  73.             You'll first write a simple Batch File that will tell
  74.             the computer to show you all the files (contents) of the
  75.             directory of the disk in drive A.
  76.  
  77.             Check to see that your formatted disk is in the A> disk drive.
  78.  
  79.             WRITING THE FIRST BATCH FILE
  80.             With your formatted disk in the disk drive, type the following
  81.             next to the A:\> Prompt, like this:
  82.                     Copy Con First.Bat
  83.                     A:
  84.                     Dir
  85.                     Press F6 key,   <then press Enter key>
  86.                    -------------
  87.  
  88.             THE BAT FILE ABOVE TELLS US:
  89.             ▀ That the first line contains the Copy command and
  90.               the name of the Bat file  (First).
  91.             ▀ The next word after Copy is "Con" which  stands
  92.               for CONsole (keyboard). Con instructs the Copy command
  93.               to copy from the keyboard what you are about to write.
  94.  
  95.             ▀ The second line "A:" stands for the A drive. This tells
  96.               the computer that you are working with the disk in
  97.               the A drive.
  98.             ▀ The third line tells the computer that you wish to see
  99.               on the screen the contents of the directory that is on
  100.               the disk in the A drive.
  101.             ▀ Line four is the Function key F6 (large key on top
  102.               row) that tells the computer (DOS) that you are
  103.               finished writing the Batch File.
  104.             All that is left now is to strike the Enter key.
  105.             The Batch file will be saved on the disk in the A> drive.
  106.  
  107.           Now you will write four Batch files that will be used
  108.          to change the screen color (Background) to Blue or Red and
  109.          the letters to White or Yellow. You'll then display the
  110.          files in the A: directory.
  111.  
  112.             WRITING THE FIRST COLOR BATCH-FILE  (BB.Bat)
  113.             (BB.Bat.. Blue Screen...also called Background)
  114.             Type the following next to the A:\> Prompt, like
  115. sa            this:
  116.                         Copy Con BB.Bat
  117.                         BB.Bat
  118.                         Dir
  119.                         Press F6 key, then press Enter key.
  120.                        -------------
  121.  
  122.         WRITING THE SECOND COLOR BATCH-FILE  (W.Bat)
  123.         (W.Bat..White letters... also called Foreground)
  124.  
  125.  
  126.                                -4-
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.         Type the following next to the A> Prompt, like this:
  134.  
  135.                         Copy Con W.Bat
  136.                         W.Bat
  137.                         Dir
  138.                         Press F6 key, then press Enter key.
  139.                        -------------
  140.  
  141.         WRITING THE THIRD COLOR BATCH-FILE  (Y.Bat)
  142.         (Y.Bat.. Yellow letters)
  143.         Type the following next to the A> Prompt. like this:
  144.  
  145.                         Copy Con Y.Bat
  146.                         Y.Bat
  147.                         Dir
  148.                         Press F6 key, then press Enter key.
  149.                        -------------
  150.  
  151.         WRITING THE FOURTH COLOR BATCH-FILE  (RB.Bat)
  152.         (RB.Bat.. Red background)
  153.  
  154.                         Copy Con RB.Bat
  155.                         RB.Bat
  156.                         Dir
  157.                         Press F6 key, then press Enter key.
  158.                        -------------
  159.  
  160.         We'll now go to Chapter 2 and see the Color Codes
  161.         for the 8 foreground and 8 background colors.
  162.  
  163.         (8 X 8 =64 possible color combinations)
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.                                  -5-
  193.